#ifndef TURNSCORESELECTDLG_H
#define TURNSCORESELECTDLG_H

#include <QDialog>
#include <QList>

#include "Game.h"
class QPushButton;
namespace Ui {
    class TurnScoreSelectDlg;
}

class TurnScoreSelectDlg : public QDialog
{
    Q_OBJECT

  public:
    static Game getRound(QWidget *parent, const QString& p1, const QString& p2);

  public slots:
    void onScoreSelected();
    void onBagScoreSelected();
    void onRoundSelected(bool checked);

  protected:
    void closeEvent(QCloseEvent *e);
    void addNewRoundBtn(QPushButton *btn, bool bag);
    int getRoundPosBtn(QPushButton *btn);

  private:
    explicit TurnScoreSelectDlg(QWidget *parent = 0);
    ~TurnScoreSelectDlg();

    Ui::TurnScoreSelectDlg *ui;
    QList<QPushButton*> mScoreBtns, mBagScoreBtns, mRoundBtns;
    int mSelectedScore;
    bool mAndTheBag;
    QPushButton *mCurSelected, *mSelectedRound;
    Game mGame;
    QString mPlayer1, mPlayer2;
};

#endif // TURNSCORESELECTDLG_H
